package com.linkwedo.saas.project;

import java.sql.Timestamp;

import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.interceptor.ServletRequestAware;

import com.linkwedo.saas.domain.Project;
import com.linkwedo.saas.util.DateUtil;
import com.opensymphony.xwork2.ActionSupport;


public class DeleteTaskAction extends ActionSupport implements ServletRequestAware{
	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	private static final long serialVersionUID = 8190003683775267839L;
	private TaskService taskService;
	
	private Integer taskid;

	private javax.servlet.http.HttpServletRequest request;
	public void setServletRequest(HttpServletRequest request) {
		// TODO Auto-generated method stub
		this.request=request;
	}
	
	private List<Project> list;
	public List<Project> getList() {
		return list;
	}

	public void setList(List<Project> list) {
		this.list = list;
	}	
	public String execute() throws Exception {
		String idStr=request.getParameter("taskid");
		if(null == idStr || idStr.equalsIgnoreCase("")){
			return ERROR;
		}
		taskid = Integer.parseInt(idStr);
		getTaskService().deleteById(taskid);//.disableById(pid)
		//getTargetService().disableById(targetid);
		list=getTaskService().findAll();
		return "ok";
	}

	public TaskService getTaskService() {
		return taskService;
	}

	public void setTaskService(TaskService taskService) {
		this.taskService = taskService;
	}

	public Integer getTaskid() {
		return taskid;
	}

	public void setTaskid(Integer taskid) {
		this.taskid = taskid;
	}


	
	
	}
